package org.example.hw.dto.user;

import java.util.Date;

import javax.validation.constraints.Past;
import javax.validation.constraints.Size;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.format.annotation.DateTimeFormat;

public class RegisterUserDto {

	@NotBlank
	@Size(min = 3, max = 10)
	private String username;

	@NotBlank
	private String password;

	@NotBlank
	private String passwordRetyped;

	private String firstname;

	private String lastname;

	@Email
	@NotBlank
	private String email;

	@DateTimeFormat
	@Past
	private Date dateOfBirth;

	public RegisterUserDto() {

	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPasswordRetyped() {
		return passwordRetyped;
	}

	public void setPasswordRetyped(String passwordRetyped) {
		this.passwordRetyped = passwordRetyped;
	}

	public Date getDateOfBirth() {
		return dateOfBirth;
	}

	public void setDateOfBirth(Date dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).
				append("username", username).
				append("firstname", firstname).
				append("lastname", lastname).
				append("dateOfBirth", dateOfBirth).
				append("email", email).
				toString();
	}

}
